<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'testcase.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script src="<%=basePath %>app/javascripts/jquery-1.5.1.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=basePath %>common/acbox/css/jquery.ajaxComboBox.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath %>common/acbox/sample.css">
 	
	<script type="text/javascript" src="<%=basePath %>common/acbox/js/jquery.ajaxComboBox.4.2.js"></script>
    <script>
	var data = [
			{'id':'A001','name':'Adams','post':'Sales','position':'The rank and file'},
	{'id':'A002','name':'Darling','post':'Sales','position':'The rank and file'},
	{'id':'A003','name':'Kingston','post':'General Affairs','position':'Chief clerk'},
	{'id':'A004','name':'Darling','post':'General Affairs','position':'Section chief'},
	{'id':'A005','name':'Adams','post':'Personnel','position':'The rank and file'},
	{'id':'A006','name':'Kingston','post':'Sales','position':'Director'},
	{'id':'A007','name':'Kingston','post':'Sales','position':'Section chief'},
	{'id':'A008','name':'Darling','post':'Personnel','position':'Chief'},
	{'id':'A009','name':'Adams','post':'Personnel','position':'Chief'},
	{'id':'A010','name':'Adams','post':'General Affairs','position':'The rank and file'},
	{'id':'A011','name':'Darling','post':'General Affairs','position':'The rank and file'},
	{'id':'A012','name':'Kingston','post':'Sales','position':'The rank and file'},
	{'id':'A013','name':'MacKenzie','post':'Sales','position':'Chief clerk'},
	{'id':'A014','name':'Darling','post':'Sales','position':'Vice-chief'},
	{'id':'A015','name':'MacKenzie','post':'General Affairs','position':'Vice-chief'},
	{'id':'A016','name':'Kingston','post':'Personnel','position':'Director'},
	{'id':'A017','name':'MacKenzie','post':'Personnel','position':'Section chief'},
	{'id':'A018','name':'MacKenzie','post':'Sales','position':'Chief'}
	];
	jQuery(document).ready(function($){
	
	  $('#ac05_01').ajaxComboBox(
	'<%=basePath%>/dict/ajaxcombox.do',
	{
	  'lang'        : 'en',
	  'db_table'    : 'prefectures',
	  'order_field' : 'id',
	  'select_only' : false,
	  'primary_key' : 'id'
	}
  );
	  }
	  )
	  function displayResult(id){
	if($('#' + id + '_hidden').length > 0){
		alert($('#' + id + '_hidden').val());
	}else{
		alert($('#' + id).val());
	}
}
	</script>
  </head>
  
  <body>
    <h5 id="sample05_01">Basic</h5>

		<p>

			Set JSON object instead of a name of server-side file.

		</p>
        <input id="data" name="data" value="test">
		<label for="ac05_01">Employee:</label>

		<input id="ac05_01" name="ac05_01" type="text">

		<input class="check_btn" type="button" value="Check the value." onclick="displayResult('ac05_01')" />



 
  </body>
</html>

